#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

#define SIZE(a) (sizeof(a) / sizeof(a[0]))
/**********************************************************************
 *                          COMMENT                                   *
 **********************************************************************/

void max_min(const int arr[], int n, int* pmax, int* pmin) {
	for (int i = 1; i < n; i++) {
		if (arr[i] > *pmax) {
			pmax = &arr[i];
		} else if (arr[i] < *pmin) {
			pmin = &arr[i];
		}
	}
}

int main(void) {
	int arr[] = { 9, 5, 2, 7, 1, 3, 4, 0, 6, 8 };
	// int min, max;
	int* pmin = &arr[0];
	int* pmax = &arr[0];
	max_min(arr, SIZE(arr), pmax, pmin);

	printf("min = %d, max = %d\n", *pmin, *pmax);
	return 0;
}